package com.dingpeikeji.quickdeer.mobile.service;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.utils.DateUtils;
import com.dingpeikeji.quickdeer.core.modules.orders.dao.TOrdersDao;
import com.dingpeikeji.quickdeer.core.modules.orders.entity.TOrders;
import com.dingpeikeji.quickdeer.core.modules.realsche.entity.TRealsche;
import com.dingpeikeji.quickdeer.core.modules.site.entity.TSitedtl;
import com.dingpeikeji.quickdeer.core.modules.site.service.TSitedtlService;
import com.dingpeikeji.quickdeer.mobile.dao.DestinationDao;
import com.dingpeikeji.quickdeer.mobile.entity.DestinationInfo;
import com.dingpeikeji.quickdeer.modules.realsche.dao.FRealscheDao;
import com.dingpeikeji.quickdeer.modules.rentproduct.dao.TDemandsDao;
import com.dingpeikeji.quickdeer.modules.rentproduct.entity.DemandsReact;
import com.dingpeikeji.quickdeer.modules.rentproduct.entity.TDemands;
import com.google.common.collect.Maps;

@Service
@Transactional(readOnly = true)
public class DestinationService {
	
	private Logger logger = LoggerFactory.getLogger(getClass());
	
	@Autowired
	private DestinationDao destinationDao; 
	
	/**
	 * 获取行程目的地
	 */
	public String[] getDestinationList(String tripId) {
		
		List<DestinationInfo> a =destinationDao.getDestinationList(tripId);
		String[] name=new String[a.size()];
		for(int i=0;i<a.size();i++){
			name[i]=destinationDao.getNameByCode(a.get(i).getDestination());
		}
		return name;
	}
	
	/**
	 * 存入行程目的地
	 */
	public Integer insertDestination(DestinationInfo info) {
		return destinationDao.insertDestination(info);
	}
	
	
	
}
